package company.tx1;

import java.util.Arrays;
import java.util.Scanner;

public class Tx4 {

    // n为偶数  n-1必为奇数 (n-1)/2
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[n];
        int[] sort = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
            sort[i] = array[i];
        }
        Arrays.sort(sort);
        int left = sort[n / 2 - 1];
        int right = sort[n / 2];
        for (int i = 0; i < n; i++) {
            if (array[i] <= left)
                System.out.println(right);
            else
                System.out.println(left);
        }
    }
}
